package com.foreknow.springboot_demo.threaddemo;

public class TestSleepDemo1 {
    public static void show(){
        int num = 10;
        while (true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("num:"+num--);
            if (num<=0){
                break;
            }
        }
    }

    public static void main(String[] args) {
        show();
    }
}
